package com.itaming.lycheeframework.mybatisflex.base;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mybatisflex.annotation.Id;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 基础实体类
 *
 * @author A.Ming
 */
@Data
public class BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @Id
    private Long id;

    /**
     * 创建人
     */
    @JsonIgnore
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Long createUser;

    /**
     * 创建时间
     */
    @JsonIgnore
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @JsonIgnore
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Long updateUser;

    /**
     * 更新时间
     */
    @JsonIgnore
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private LocalDateTime updateTime;

    /**
     * 是否已删除
     */
    @JsonIgnore
    private Integer isDeleted;

}
